package com.toppitch.site.data;

import java.sql.ResultSet;
import java.sql.SQLException;

import com.toppitch.site.db.IGetFromResultSet;

public class HedgeFund extends User implements IGetFromResultSet {
	private String name;
	private String password;

	public String toUpdateString() {
		return "update hf set " + //
				"name='" + name.replace("'", "''") + "', " + //
				"password='" + password.replace("'", "''") + "', " + //
				"photoId='" + photoId.replace("'", "''") + "' " + //
				"where lower(email)='" + email.toLowerCase().replace("'", "''") + "'";
	}

	public void getFromResultSet(ResultSet rs) throws SQLException {
		name = rs.getString("name");
		email = rs.getString("email");
		password = rs.getString("password");
		photoId = rs.getString("photoId");
	}

	public String toInsertString() {
		return toInsertString("hf", name, email.toLowerCase(), password, photoId);
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getFullName() {
		return name;
	}

	public boolean isStudent() {
		return false;
	}

}
